﻿#pragma strict

public var action : String;
public var manager : GameObject;

function OnMouseDown()
{	
	if (action == 'Build')
	{
		manager.SendMessage('ActionBuild');
	}
	else if (action == 'Time')
	{
		manager.SendMessage('ActionTime');
	}
	else if (action == 'Mood')
	{
		manager.SendMessage('ActionMood');
	}
	else if (action == 'pause')
	{
		manager.SendMessage('Pause');
	}
	else if (action == 'Reset')
	{
		manager.SendMessage('Reset');
	}
	else if (action == 'Random')
	{
		var rdm :int = Random.Range(1, 4);
		if (rdm == 1)
			manager.SendMessage('ActionBuild');
		else if (rdm == 2)
			manager.SendMessage('ActionTime');
		else
			manager.SendMessage('ActionMood');
	}
	else if (action == 'Quitter')
	{
		Application.Quit();
	}
	else
	{	
		Application.LoadLevel(action);
	}
}